#include<stdio.h>
#include<string.h>
#include<assert.h>
#include<ctype.h>
#include<malloc.h>
#include<math.h>
#include<stdlib.h>
#include<locale.h>
#ifndef EVERYTHING_INCLUDED
    #define EVERYTHING_INCLUDED
    enum ERRORS{SYNTAX_ERROR, POINTER_ERROR};
    enum lexemeTypes{VARIABLE = -10, NUMBER, OPERATOR, FUNCTION};
    enum operatorTypes{
        ADD = 1,
        DEC = 2,
        SKIP = 3,
        MUL = 4,
        MOV = 5,
        GREATER = 6,
        LESS = 7,
        GE = 8,
        LE = 9,
        MINUS_BIN = 10,
        MINUS_UN = 11,
        DIV = 12,
        BR_OP = 13,
        BR_CL = 14,
        BL_OP = 15,
        BL_CL = 16,
        OP = 17,
        EOPR = 18
    };
    struct variable
    {
        int isFunction;
        char name[32];
        double value;
        //amount of arguments
        int args;

    };
    struct  lexeme
    {
        int  lexType;
        double value;
        int opType;
        char name[32];
    };
    struct label
    {
        int position;
        char name[32];
    };
    struct program
    {
        int length;
        int numofVar;
        int numofLabel;
        struct variable var[30];
        struct lexeme lex[2048];
    };
#endif // EVERYTHING_INCLUDED

program* syntaxAn(FILE* f);
long fileLength(FILE* f);
int isOperator(char* str);
double getN(char* str);
char* deleteSpacesBuf(FILE* f);
int printLexemes(program* pr);

